Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OidcTestClient #36110

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Add OidcTestClient #36110

merged 1 commit into from
Sep 25, 2023

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Sep 22, 2023

The main motivation is to help Auth0 or other SaaS OIDC users to test against live test domains, where quarkus.oidc.auth-server-url is pointing to some US or EU domain. The only other options for such cases is testing with Wiremocks and unit testing with @TestSecurity. In fact this will also work for Keycloak test realms, where quarkus.oidc.auth-server-url is pointing to them, without depending on Dev Services for Keycloak.

It also fixes #30080.

After some time I've confirmed today I can write a test against the Auth0 domain which is covered in #35931.

So once this PR is ready for review and is approved, I'll update #35931.

@github-actions
Copy link

github-actions bot commented Sep 23, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

@sberyozkin
Copy link
Member Author

sberyozkin commented Sep 24, 2023

Hey @gastaldi @pedroigor Have a look please next week, this is a simple test client as an alternative to KeycloakTestClient. If we have a non-Keycloak provider, then the only option is a Wiremock based integration testing. OidcTestClient is a small utility class which expects quarkus.oidc.auth-server-url, quarkus.oidc.client-id, quarkus.oidc.credentials.secret configured - and it will discover the provided token url, and can help with password or client credential token requests against the live provider endpoint, ex, Development Auth0 tenant, etc, and then users can write tests passing these live tokens to the tested endpoint.

Will update the Auth0 tutorial afterwards

@sberyozkin sberyozkin merged commit c8d4533 into quarkusio:main Sep 25, 2023
22 checks passed
@sberyozkin sberyozkin deleted the oidc_test_client branch September 25, 2023 12:22
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Sep 25, 2023
@gsmet gsmet modified the milestones: 3.5 - main, 3.4.2 Oct 3, 2023
@gsmet gsmet modified the milestones: 3.4.2, 3.5 - main Oct 3, 2023
@gsmet
Copy link
Member

gsmet commented Oct 3, 2023

I removed it from the backports as parts of it rely on other changes (it doesn't compile in 3.4). Moreover it really looks like a new feature so I think it's better to wait for 3.5.

Let me know if you think otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

OIDCWiremockTestResource and password authorisation
3 participants